<?php
/*
	Copyright 2006, 2007, 2008, 2009, 2010 Bastiaan Grutters
    
    This file is part of Ages of Strife website.

    Ages of Strife website is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Ages of Strife website is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Ages of Strife website.  If not, see <http://www.gnu.org/licenses/>.
 */
include( '../global/initialize.php' );

aos_header( 'Premium turns shop' );
?>
					<h2>Ages of Strife: <?php transprint( 'Premium turns shop' ); ?></h2><br />
					<br />
					<?php

$query = "SELECT open_shop FROM game LIMIT 1";
$result = mysql_query( $query ) or die( "Query failed : " . mysql_error() );
$row = mysql_fetch_array( $result, MYSQL_ASSOC );

if( $row[ 'open_shop' ] == 1 ) {
	
	if( isset( $_GET[ 'show' ] ) && $_GET[ 'show' ] == 'advantages' ) {
		$showAdvantages = true;
	}
	else {
		$showAdvantages = false;
	}
	
	$url = "www.paypal.com";
	// For testing:
	//$url = "www.sandbox.paypal.com";
	
	if( isset( $_GET[ 'user_id' ] ) && is_numeric( $_GET[ 'user_id' ] ) && $_GET[ 'user_id' ] > 0 ) {
		$query = "SELECT name " .
				"FROM ruler " .
				"WHERE user_id = " . $_GET[ 'user_id' ];
		$result = mysql_query( $query ) or die( "Query failed : " . mysql_error() );
		$row = mysql_fetch_array( $result, MYSQL_ASSOC );
		
		if( isset( $row[ 'name' ] ) ) {
			if( isset( $_GET[ 'anonymous' ] ) && $_GET[ 'anonymous' ] == 1 ) {
				$anonymous = 1;
				$title = translate( "Select an anonymous gift for" ) . " " . $row[ 'name' ];
			}
			else {
				$anonymous = 0;
				$title = translate( "Select a gift for" ) ." " . $row[ 'name' ];
			}
			$custom = $_SESSION[ 'user_id' ] . '_' . $_GET[ 'user_id' ] . '_' . $anonymous;
		}
		else {
			$error = translate( "Unknown user_id provided." );
		}
	}
	else {
		$title = translate( "Select amount of premium turns" );
		$custom = $_SESSION[ 'user_id' ] . '_' . $_SESSION[ 'user_id' ] . '_0';
	}
					?>
					<div class="blok collapsable closed" id="premium-turns-blok">
						<a title="<?php transprint( 'Click to expand or collapse' ); ?>" href="javascript:void(null)" onclick="toggleBlok( 'premium-turns-blok' );"><strong><?php transprint( 'What are premium turns?' ); ?></strong></a><br />
						<br />
						<?php transprint( 'You can purchase premium turns for Ages of Strife, during these turns you will not be shown any advertisement,' ); ?><br />
						<?php transprint( 'instead statistics and information about your account is shown in its place such as what you are upgrading, your buddies, your score and much more.' ); ?><br />
						<br />
						<em><?php transprint( 'Why can I can buy turns, instead of just a month premium?' ); ?></em><br />
						<?php transprint( 'This is because during rounds the game is suspended and if there are no turns you don\'t have to pay.' ); ?><br />
						<?php transprint( 'Furthermore premium turns are deducted at the end of each turn update, this means that if for any reason a turn update fails a premium turn will NOT be deducted.' ); ?><br />
						<br />
						<em><?php transprint( 'So how long will my premium turns last?' ); ?></em><br />
						<?php transprint( 'When the game is running without interuptions 1,000 premium turns will last for:' ); ?><br />
						<?php transprint( '1,000 turns : 24 hours = 41.67 days' ); ?><br />
						<?php transprint( 'So 1 month, 10 days and some hours for 1,000 turns.' ); ?><br />
						<br />
						<?php transprint( 'By buying premium turns you are supporting Ages of Strife!' ); ?><br /> 
					</div>
					<br />
					<div class="blok collapsable <?php print( !$showAdvantages ? 'closed' : 'open' ); ?>" id="premium-turns-advantage-blok">
						<a title="<?php transprint( 'Click to expand or collapse' ); ?>" href="javascript:void(null)" onclick="toggleBlok( 'premium-turns-advantage-blok' );"><strong><?php transprint( 'What do I get when I have premium turns' ); ?>?</strong></a><br />
						<br />
						<ul>
							<li><?php transprint( 'Each turn your officers receive 5 experience points instead of just 2' ); ?></li>
							<li><?php transprint( 'You can set a custom army base name in account settings, which will automatically suggest army names like:' ); ?><br />
								<?php transprint( '1st (custom name), 2nd (custom name), 3rd (custom name), etc' ); ?></li>
							<li><?php transprint( 'You are not shown any advertisement, which means the site will load faster' ); ?></li>
							<li><?php transprint( 'You have a special list showing a lot of information among which a list of your 5 last active buddies' ); ?></li>
							<li><?php transprint( 'You can view charts about your progress, armies, villages and more' ); ?></li>
							<li><?php transprint( 'You can queue up to 9 buildings, upgrades and expeditions instead of only 3' ); ?></li>
							<li><?php transprint( 'You can create 9 trade offers at once instead of only 3' ); ?></li>
							<li><?php transprint( 'Auto trade offers created every 3 game days 9 instead of only 3' ); ?></li>
							<li><?php transprint( 'You can store up to 20 locations instead of only 3' ); ?></li>
							<li><?php transprint( 'You get offered private trades by independent traders' ); ?></li>
							<li><?php transprint( 'You can set your workers to be automatically assigned per village' ); ?></li>
							<li><?php transprint( 'Sort trades by requested and/or offered resource' ); ?></li>
						</ul>
					</div>
					<br />
					<div class="blok collapsable closed" id="buying-online-blok">
						<a title="<?php transprint( 'Click to expand or collapse' ); ?>" href="javascript:void(null)" onclick="toggleBlok( 'buying-online-blok' );"><strong><?php transprint( 'How to buy online?' ); ?></strong></a><br />
						<br />
						<?php transprint( 'Premium turns can only be purchased online through the PayPal payment system.' ); ?><br />
						<?php transprint( 'For more information about PayPal click' ); ?> <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_home-general&nav=0" target="_blank"><?php transprint( 'here' ); ?></a>.<br />
						<br />
						<?php transprint( 'PayPal accepts the following methods of payment:' ); ?><br />
						<img src="../resources/logo_ccVisa.gif" alt="Visa" /> <img src="../resources/logo_ccMC.gif" alt="MasterCard" /> <img src="../resources/logo_ccAmex.gif" alt="American Express" /> <img src="../resources/logo_ccDiscover.gif" alt="Discover" /> <img src="../resources/logo_ccPayPal.gif" alt="Bank" /><br />
						<br />
						<?php transprint( 'When entering your credit card information in any website:' ); ?><br />
						<ul>
							<li><?php transprint( 'make sure you don\'t have any keyloggers on your computer, you can check if any are present by using an adware or virus scanner' ); ?></li>
							<li><?php transprint( 'make sure you are at the correct site' ); ?></li>
							<li><?php transprint( 'make sure the site where you enter your information is using SSL (URL in the address bar starts with https://)' ); ?></li>
						</ul>
						<br />
						<?php transprint( 'If you need any help or have questions about purchasing premium turns you can e-mail them to' ); ?> <a href="mailto:premium@agesofstrife.com">premium@agesofstrife.com</a>.<br />
					</div>
					<br />
					<div class="blok collapsable closed" id="step-by-step-blok">
						<a title="<?php transprint( 'Click to expand or collapse' ); ?>" href="javascript:void(null)" onclick="toggleBlok( 'step-by-step-blok' );"><strong><?php transprint( 'Purchasing premium turns: Step by step' ); ?></strong></a><br />
						<ul>
							<li><?php transprint( 'When you click on a "Buy now" button you will be taken to the PayPal site' ); ?></li>
							<li>
								<?php transprint( 'There you can chose between paying with a credit card or with your PayPal account' ); ?>
								<ul>
									<li><?php transprint( 'If you choose to pay with your credit card, you will have to fill in your credit card details' ); ?></li>
									<li><?php transprint( 'If you choose to pay with your PayPal account you have to log in using your PayPal log in information' ); ?></li>
								</ul>
							</li>
							<li><?php transprint( 'After you filled in your credit card information or logged in to PayPal you will be taken to a payment review page' ); ?></li>
							<li><?php transprint( 'If you press the "Pay now" button your purchased will be finalized and you will be taken to status overview page' ); ?></li>
							<li><?php transprint( 'This page will send you back to the Ages of Strife website after 10 seconds' ); ?></li>
							<li><?php transprint( 'Back here you will be presented with an purchase complete screen and your premium turns have been added to your account' ); ?></li>
						</ul>
						<?php transprint( 'Note: If you have logged out of Ages of Strife during your purchase you will have to log in to the game again once your purchase is complete.' ); ?><br />
					</div>
					<br />
					<div class="blok shop-list collapsable <?php print( $showAdvantages ? 'closed' : 'open' ); ?>" id="item-list-blok">
						<a title="<?php transprint( 'Click to expand or collapse' ); ?>" href="javascript:void(null)" onclick="toggleBlok( 'item-list-blok' );"><strong><?php print( $title ); ?></strong></a><br />
						<br />
						1,000 <?php transprint( 'premium turns for' ); ?> 2.00 USD<br />
						<form action="https://<?php print( $url ); ?>/cgi-bin/webscr" method="post">
							<input type="hidden" name="custom" value="<?php print( $custom ); ?>" />
							<input type="hidden" name="cmd" value="_xclick" />
							<input type="hidden" name="business" value="premium@agesofstrife.com" />
							<input type="hidden" name="item_name" value="1,000 premium turns" />
							<input type="hidden" name="item_number" value="1" />
							<input type="hidden" name="amount" value="2.00" />
							<input type="hidden" name="shipping" value="0.00" />
							<input type="hidden" name="no_shipping" value="1" />
							<input type="hidden" name="no_note" value="1" />
							<input type="hidden" name="currency_code" value="USD" />
							<input type="hidden" name="tax" value="0.00" />
							<input type="hidden" name="lc" value="US" />
							<input type="hidden" name="bn" value="PP-BuyNowBF" />
							<input type="image" src="https://<?php print( $url ); ?>/en_US/i/btn/btn_buynow_SM.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!" />
							<img alt="" border="0" src="https://<?php print( $url ); ?>/en_US/i/scr/pixel.gif" width="1" height="1" />
						</form><br />
						<br />
						3,000 <?php transprint( 'premium turns for' ); ?> 5.00 USD<br />
						<form action="https://<?php print( $url ); ?>/cgi-bin/webscr" method="post">
							<input type="hidden" name="custom" value="<?php print( $custom ); ?>" />
							<input type="hidden" name="cmd" value="_xclick" />
							<input type="hidden" name="business" value="premium@agesofstrife.com" />
							<input type="hidden" name="item_name" value="3,000 premium turns" />
							<input type="hidden" name="item_number" value="2" />
							<input type="hidden" name="amount" value="5.00" />
							<input type="hidden" name="shipping" value="0.00" />
							<input type="hidden" name="no_shipping" value="1" />
							<input type="hidden" name="no_note" value="1" />
							<input type="hidden" name="currency_code" value="USD" />
							<input type="hidden" name="tax" value="0.00" />
							<input type="hidden" name="lc" value="US" />
							<input type="hidden" name="bn" value="PP-BuyNowBF" />
							<input type="image" src="https://<?php print( $url ); ?>/en_US/i/btn/btn_buynow_SM.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!" />
							<img alt="" border="0" src="https://<?php print( $url ); ?>/en_US/i/scr/pixel.gif" width="1" height="1" />
						</form><br />
						<br />
						6,000 <?php transprint( 'premium turns for' ); ?> 9.00 USD<br />
						<form action="https://<?php print( $url ); ?>/cgi-bin/webscr" method="post">
							<input type="hidden" name="custom" value="<?php print( $custom ); ?>" />
							<input type="hidden" name="cmd" value="_xclick" />
							<input type="hidden" name="business" value="premium@agesofstrife.com" />
							<input type="hidden" name="item_name" value="6,000 premium turns" />
							<input type="hidden" name="item_number" value="3" />
							<input type="hidden" name="amount" value="9.00" />
							<input type="hidden" name="shipping" value="0.00" />
							<input type="hidden" name="no_shipping" value="1" />
							<input type="hidden" name="no_note" value="1" />
							<input type="hidden" name="currency_code" value="USD" />
							<input type="hidden" name="tax" value="0.00" />
							<input type="hidden" name="lc" value="US" />
							<input type="hidden" name="bn" value="PP-BuyNowBF" />
							<input type="image" src="https://<?php print( $url ); ?>/en_US/i/btn/btn_buynow_SM.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!" />
							<img alt="" border="0" src="https://<?php print( $url ); ?>/en_US/i/scr/pixel.gif" width="1" height="1" />
						</form><br />
						<br />
						12,000 <?php transprint( 'premium turns for' ); ?> 17.00 USD<br />
						<form action="https://<?php print( $url ); ?>/cgi-bin/webscr" method="post">
							<input type="hidden" name="custom" value="<?php print( $custom ); ?>" />
							<input type="hidden" name="cmd" value="_xclick" />
							<input type="hidden" name="business" value="premium@agesofstrife.com" />
							<input type="hidden" name="item_name" value="12,000 premium turns" />
							<input type="hidden" name="item_number" value="4" />
							<input type="hidden" name="amount" value="17.00" />
							<input type="hidden" name="shipping" value="0.00" />
							<input type="hidden" name="no_shipping" value="1" />
							<input type="hidden" name="no_note" value="1" />
							<input type="hidden" name="currency_code" value="USD" />
							<input type="hidden" name="tax" value="0.00" />
							<input type="hidden" name="lc" value="US" />
							<input type="hidden" name="bn" value="PP-BuyNowBF" />
							<input type="image" src="https://<?php print( $url ); ?>/en_US/i/btn/btn_buynow_SM.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!" />
							<img alt="" border="0" src="https://<?php print( $url ); ?>/en_US/i/scr/pixel.gif" width="1" height="1" />
						</form><br />
						<br />
						<?php transprint( 'To give premium turns to another Ages of Strife ruler click' ); ?> <a href="gift.php"><?php transprint( 'here' ); ?></a>.<br />
						<br />
						<?php transprint( 'Payments are processed by' ); ?> <img src="../resources/logo_ccPayPal.gif" alt="PayPal" />
					</div>
					<br />
					<div class="blok">
<?php
	if( isset( $_SESSION[ 'ruler_id' ] ) ) {
?>
						<?php transprint( 'To go back to the game click' ); ?> <a href="../overview/overview.php"><?php transprint( 'here' ); ?></a>.
<?php
	}
	else {
?>
						<?php transprint( 'To sign up a ruler click' ); ?> <a href="../global/sign_up.php"><?php transprint( 'here' ); ?></a>.
<?php
	}
?>
					</div>
					<?php
}
else {
?>
					<div class="blok">
						<?php transprint( 'The shop is currently closed on this server.' ); ?><br />
						<br />
						<?php transprint( 'Click' ); ?> <a href="../overview/overview.php"><?php transprint( 'here' ); ?></a> <?php transprint( 'to go back to the game.' ); ?>
					</div>
<?php
}
?>
					<script type="text/javascript" src="shop.js"></script>
<?php
aos_footer();
?>